home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / MacSource / Animate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-14  |  3.1 KB  |  84 lines  |  [TEXT/CWIE]

  1. /*==============================================================================
  2. Project:    POV
  3.  
  4. File:    Animate.h
  5.  
  6. Description:
  7. Routines to handle the clock animation variable prompting for POV-Ray.
  8.  
  9. ------------------------------------------------------------------------------
  10. Author:
  11.     Eduard [esp] Schwan
  12. ------------------------------------------------------------------------------
  13.     from Persistence of Vision(tm) Ray Tracer
  14.     Copyright 1996 Persistence of Vision Team
  15. ------------------------------------------------------------------------------
  16.     NOTICE: This source code file is provided so that users may experiment
  17.     with enhancements to POV-Ray and to port the software to platforms other 
  18.     than those supported by the POV-Ray Team.  There are strict rules under
  19.     which you are permitted to use this file.  The rules are in the file
  20.     named POVLEGAL.DOC which should be distributed with this file. If 
  21.     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  22.     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  23.     Forum.  The latest version of POV-Ray may be found there as well.
  24.  
  25.     This program is based on the popular DKB raytracer version 2.12.
  26.     DKBTrace was originally written by David K. Buck.
  27.     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  28. ------------------------------------------------------------------------------
  29. Change History:
  30.     930226    [esp]    Created
  31.     930605    [esp]    Changed initial frame # from zero to one
  32.     930728    [esp]    Added frameValS/frameValE, removed curr fields
  33.     930816    [esp]    Added pAnimPtr to SetCurrFrameVal
  34.     931001    [esp]    version 2.0 finished (Released on 10/4/93)
  35. ==============================================================================*/
  36.  
  37. #if !defined(ANIMATE_H)
  38. #define ANIMATE_H
  39.  
  40. #include "config.h"
  41. #include <types.h>
  42.  
  43. // This resource/struct will be saved to disk, and should match
  44. // its 68K equivalent...
  45. #if GENERATINGPOWERPC
  46. #pragma options align=mac68k
  47. #endif
  48.  
  49. // Note that the working variables (current frame/clock) are not stored
  50. // in this structure (since they don't need to be saved), and are declared
  51. // as static globals in animate.c instead, with accessor functions.
  52. typedef struct
  53. {
  54.     short        frameVal0;        /* Initial animation frame, always implied one */
  55.     short        frameValS;        /* Current Frame to start session at */
  56.     short        frameValE;        /* Current Frame to end session at */
  57.     short        frameValN;        /* Final animation frame */
  58.     float        clockVal0;        /* initial "clock" value (1st frame) */
  59.     float        clockValN;        /* final "clock" value (last frame) */
  60. } AnimRec_t, *AnimPtr_t, **AnimHdl_t;
  61.  
  62. #if GENERATINGPOWERPC
  63. #pragma options align=reset
  64. #endif
  65.  
  66.  
  67. // Set local current frame value (and calculate current clock value too)
  68. void SetCurrFrameVal(AnimPtr_t pAnimPtr, short newFrameVal);
  69.  
  70. // Return local current frame value
  71. short GetCurrFrameVal(void);
  72.  
  73. // Return local current clock value
  74. float GetCurrClockVal(void);
  75.  
  76. float CalcClockVal(AnimPtr_t pAnimPtr, short currFrameVal);
  77.  
  78. // Increment Frame counter if not already finished, and recalculate
  79. // new clock value.  Return false if past last frame
  80. Boolean IncToNextFrame(AnimPtr_t pAnimPtr);
  81.  
  82.  
  83. #endif // ANIMATE_H
  84.